package com.code.coinprice.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.code.coinprice.mappers.CoinPriceDictMapper;
import com.code.coinprice.models.CoinPriceDict;
import com.code.coinprice.services.CoinPriceDictService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CoinPriceDictServiceImpl implements CoinPriceDictService {

    @Resource
    private CoinPriceDictMapper coinPriceDictMapper;

    @Override
    public String getDictValueByDictKey(String dictKey) {
        QueryWrapper<CoinPriceDict> wrapper = new QueryWrapper<>();
        wrapper.eq("dict_key", dictKey);
        return coinPriceDictMapper.selectOne(wrapper).getDictValue();
    }
}
